package second;

import dao.ItemDao;
import dao.OrderDao;

/**
 * 业务组件
 * 
 * @author Wangpeihu
 * @team [Never give up]
 * @since JDK1.6(建议)
 * @date 2010-2-4
 */
public class StoreServiceImpl implements StoreService {
	public OrderDao getOrderDao() {
		return orderDao;
	}

	public ItemDao getItemDao() {
		return itemDao;
	}

	// 这个属性 IOC injection
	private OrderDao orderDao;
	private ItemDao itemDao;

	public void setOrderDao(OrderDao orderDao) {
		this.orderDao = orderDao;
	}

	public void setItemDao(ItemDao itemDao) {
		this.itemDao = itemDao;
	}

	@Override
	public void submitOrder() {
		orderDao.save();
		itemDao.update();
	}

	@Override
	public void too() {
		System.out.println("too方法执行块");
		// throw new RuntimeException();

	}

	@Override
	public boolean signin(String id, String pwd) {
		System.out.println(id + "登录" + "，密码是:" + pwd);
		return true;
	}

	@Override
	public void time() {
		System.out.println("play time ......");

	}

}
